<?php

namespace app\api\controller\user;

use app\common\controller\Api;
use think\Config;

/**
 * 用户端-用户接口
 * @ApiWeigh (79)
 */
class User extends Api
{
    protected $noNeedLogin = ['login', 'mobilelogin', 'register', 'resetpwd', 'changeemail', 'changemobile', 'third'];
    protected $noNeedRight = ['*'];

    public function _initialize()
    {
        parent::_initialize();

        if (!Config::get('fastadmin.usercenter')) {
            $this->error(__('User center already closed'));
        }

    }

    /**
     * 个人中心
     *
     * @ApiMethod (POST)
     */
    public function index()
    {
        $this->success('', ['welcome' => $this->auth->nickname]);
    }

}
